# -*- coding:utf-8 -*-#
# -------------------------------------------------------------------------
# ProjectName:       zhcx-service-test
# FileName:          testmodule.py
# Author:            xun
# Date:              2024/7/16 15:33
# Description:
# --------------------------------------------------------------------------
import sched
import time
import datetime

# 创建 scheduler 实例
scheduler = sched.scheduler(time.time, time.sleep)


def print_time(scheduler):
    print("Current time:", time.ctime())  # 打印当前时间
    scheduler.enter(10, 1, print_time, (scheduler,))  # 再次安排任务


# 首次安排任务
scheduler.enter(2, 1, print_time, (scheduler,))
# now = datetime.datetime.now()
# timestamp = int(now.timestamp())
# sched.scheduler.enterabs(timestamp,1,print_time,(scheduler,))

# 运行定时任务
# scheduler.run()



def execute_at_time(target_time):
    current_time = time.strftime("%H:%M:%S")

    while current_time != target_time:
        current_time = time.strftime("%H:%M:%S")
        time.sleep(1)

    print("当前时间已到达指定时间,执行任务")

if not None and not None:
    startTime = datetime.date.today() - datetime.timedelta(days=2)
    endTime = datetime.date.today() - datetime.timedelta(days=1)
    print(str(startTime),type(str(startTime)))
    print(str(endTime),type(str(endTime)))

list1= [('123','23'),('4')]
list2 = [('4')]
print(set(list1)-set(list2))

# srt1='2312'
# data1=[]
# data1.append(srt1)
# print(data1)
# dict1 = {'123':2,'213':4}
# print(list(dict1.keys()))
list3 = [1,2,3,4]
print(list3[3:4])